﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CloudPms.Domain.Repository;
using CloudPms.Entity.Entities;

namespace CloudPms.Logic.Interface
{
    public interface IOrderService
    {
        /// <summary>
        /// 入住
        /// </summary>
        /// <param name="order">订单</param>
        /// <param name="otherInfo">其他信息</param>
        /// <param name="face">头像</param>
        /// <param name="bills">账单</param>
        /// <param name="wares">商品</param>
        /// <param name="coupons">优惠券</param>
        /// <returns>订单编号</returns>
        string CheckIn(Order order, OrderOtherInfo otherInfo, OrderFace face, IList<Bill> bills, IList<OrderWares> wares, IList<OrderCoupon> coupons);

        /// <summary>
        /// 组装重新入住订单
        /// </summary>
        /// <param name="hotelId">酒店编号</param>
        /// <param name="orderId">重新入住的订单</param>
        Order BuildReCheckIn(string hotelId, string orderId);

        /// <summary>
        /// 修改订单
        /// </summary>
        /// <param name="order"></param>
        void EditOrder(Order order);

        /// <summary>
        /// 添加随行
        /// </summary>
        /// <param name="accompany">随行人</param>
        /// <param name="otherInfo">其他信息</param>
        /// <param name="face">头像</param>
        /// <returns>随行ID</returns>
        string AddAccompany(OrderAccompany accompany, OrderOtherInfo otherInfo, OrderFace face);

        /// <summary>
        /// 编辑其他信息
        /// </summary>
        /// <param name="otherInfo"></param>
        void EditOtherInfo(OrderOtherInfo otherInfo);
        /// <summary>
        /// 编辑头像
        /// </summary>
        /// <param name="face"></param>
        void EditGuestFace(OrderFace face);
        /// <summary>
        /// 编辑订单备注
        /// </summary>
        /// <param name="hotelId"></param>
        /// <param name="orderId"></param>
        /// <param name="memo"></param>
        void EditOrderMemo(string hotelId, string orderId, string memo);
        /// <summary>
        /// 换房
        /// </summary>
        /// <param name="order"></param>
        /// <param name="originRoom"></param>
        /// <param name="newRoom"></param>
        /// <param name="isFreeUpdate"></param>
        /// <param name="reason"></param>
        void ChangeRoom(Order order, Room originRoom, Room newRoom, bool isFreeUpdate, string reason);
        /// <summary>
        /// 编辑随行
        /// </summary>
        /// <param name="accompany"></param>
        void EditAccompany(OrderAccompany accompany);

        /// <summary>
        /// 组装退房订单
        /// </summary>
        /// <param name="order"></param>
        /// <returns>退房订单</returns>
        Order BuildCheckOut(Order order);

        /// <summary>
        /// 加入团队
        /// </summary>
        /// <param name="order">订单</param>
        /// <param name="groupId">团队编号</param>
        /// <returns></returns>
        void JoinGroup(Order order, string groupId);

        /// <summary>
        /// 离开团队
        /// </summary>
        /// <param name="order"></param>
        /// <param name="groupId"></param>
        void LeaveGroup(Order order, string groupId);

        /// <summary>
        /// 加入关联订单
        /// </summary>
        /// <param name="origin"></param>
        /// <param name="destin"></param>
        void JoinRelate(Order origin, Order destin);

        /// <summary>
        /// 离开关联订单
        /// </summary>
        /// <param name="leaver"></param>
        void RemoveRelate(Order leaver);

        /// <summary>
        /// 设置主单
        /// </summary>
        /// <param name="order"></param>
        void SetMasterOrder(Order order);

        /// <summary>
        /// 条件搜索订单
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        IList<Order> SearchOrders(SearchOrderParam param);

        /// <summary>
        /// 查找历史订单
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        IList<Order> SearchHistoryOrders(SearchOrderParam param);

        /// <summary>
        /// 模糊搜索3个月内的的退房和noshow单，以及有效订单住单 姓名，
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        IList<Order> FuzzySearchOrders(string key);
    }
}
